package com.mxl.controller;

import com.mxl.model.Users;
import com.mxl.service.UsersServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UsersServiceImpl usersService;


    @RequestMapping(value = "/getMessage")
    public Object getMessage() {
        return "您拥有用户权限，可以获得该接口的信息！";
    }

    @RequestMapping(value = "/hello")
    public Object hello(String username) {
        Users userByName = usersService.getUserByName(username);
        return userByName;
    }
}
